home *** CD-ROM | disk | FTP | other *** search
-
- #pragma once
-
- #ifndef __EVENTHANDLERTABLE__
- #define __EVENTHANDLERTABLE__
-
- #include <AppleEvents.h>
-
- //
- // We define our own EventHandlerProcPtr because we cannot predict
- // what AEEventHandlerUPP might be (a UniversalProcPtr or an
- // AEEventHandlerProcPtr), nor can we guarentee that AEEventHandlerProcPtr
- // will always be defined.
- //
- typedef pascal OSErr (*EventHandlerProcPtr)(const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefcon);
-
- //
- // More stuff that's missing from the old headers...
- //
- typedef struct OpaqueAEDispatcher *AEDispatcher;
- typedef UInt32 AEReceiveMode;
- enum {
- kAEReceiveForever = 0x00000000,
- kAEReceiveOneEvent = 0x00000001,
- kAEReceiveUntilUnhandledEvent = 0x00000002
- };
-
- //========================================================================================
- // CLASS TEventHandlerTable
- //========================================================================================
-
- class TEventHandlerTable
- {
- protected:
-
-
- public:
- TEventHandlerTable();
- ~TEventHandlerTable();
-
- OSStatus InstallHandler(AEEventClass handlerClass, AEEventID handlerID, EventHandlerProcPtr handler, UInt32 handlerRefcon);
- OSStatus Receive(AEReceiveMode receiveMode = kAEReceiveOneEvent, long maxSleepTime = 60*60 /* about one minute */);
-
- };
-
- #endif
-